home *** CD-ROM | disk | FTP | other *** search
- stop();
- Mouse.hide();
- var i = 0;
- var vspeed = 5;
- var pointBox = 0;
- var smousness = 20;
- var cloudplus = 1;
- var cloudminus = 3;
- var retchLevel = 5;
- var retchLevelNum = 0;
- var prevRotation = 0;
- var prevRotationold = 0;
- var gameGoing = true;
- _root.kid.gotoAndPlay(1);
- floating = function()
- {
- _root.kid._y += Number(_root._ymouse - 100 - _root.kid._y) / smousness;
- _root.kid._x += Number(_root._xmouse - _root.kid._x) / smousness;
- _root.kid._rotation = (_root.kid._x - _xmouse) * 0.15;
- if(_root.milklevel._currentframe >= 100)
- {
- if(Math.abs(_root.kid._rotation - _root.prevRotationold) >= 2)
- {
- _root.retchLevelNum += 3;
- }
- else
- {
- _root.retchLevelNum -= 6;
- if(_root.retchLevelNum <= 0)
- {
- _root.retchLevelNum = 0;
- }
- }
- _root.prevRotationold = _root.prevRotation;
- _root.prevRotation = _root.kid._rotation;
- _root.pukelevel.gotoAndStop(retchLevelNum);
- if(_root.retchLevelNum >= 100 && !_root.kid.puke)
- {
- _root.kid.gotoAndPlay("puke");
- _root.retchLevelNum = 0;
- _root.pukelevel.gotoAndStop(1);
- _root.milklevel.gotoAndStop(1);
- }
- }
- balloonMovment();
- };
- balloonMovment = function()
- {
- if(_root.gameGoing)
- {
- _root.balloon._x += 2;
- if(_root.balloon._x >= 560)
- {
- _root.balloon._x = random(300) - 400;
- _root.balloon.balloonNum = random(5) * 100 + 500;
- }
- }
- };
- cloudEmitter = setInterval(this,"cloudEmitting",1500);
- cloudEmitting = function()
- {
- i++;
- _root.currentlevel = i;
- whatcomes = random(100);
- if(whatcomes <= 50)
- {
- duplicateMovieClip(cloud,"cloud" + i,16384 + i);
- _root["cloud" + i]._x = random(400) + 50;
- _root["cloud" + i].whole = true;
- _root["cloud" + i].cloud = true;
- _root["cloud" + i]._xscale = random(40) + 80;
- _root["cloud" + i]._yscale = random(40) + 80;
- _root["cloud" + i].onEnterFrame = objectMoving;
- }
- else
- {
- duplicateMovieClip(dummy,"cloud" + i,16384 + i);
- _root["cloud" + i]._x = random(400) + 50;
- _root["cloud" + i].whole = true;
- _root["cloud" + i].cloud = false;
- _root["cloud" + i].gotoAndStop(random(3) + 1);
- _root["cloud" + i].onEnterFrame = objectMoving;
- }
- };
- objectMoving = function()
- {
- this._y -= vspeed;
- if(this.hitTest(_root.kid.hitBox) && this.whole)
- {
- this.whole = false;
- if(this.cloud)
- {
- _root.pointBox -= cloudminus;
- this.gotoAndPlay(2);
- this.points = "-3";
- _root.kid.gotoAndPlay("achoo");
- _root.health.gotoAndStop(_root.health._currentframe + 10);
- if(_root.health._currentframe == 101)
- {
- _root.endGame();
- }
- }
- else
- {
- _root.kid.mouth.gotoAndPlay("smile");
- _root.goodSnd.start();
- this.gotoAndStop(4);
- this.points = "+" + this.pointvalue;
- _root.pointBox += this.pointvalue;
- _root.milklevel.gotoAndStop(_root.milklevel._currentframe + 3 * this.pointvalue);
- }
- }
- else if(this.hitTest(_root.kid.parahitBox) && this.whole)
- {
- this.whole = false;
- this.gotoAndPlay(2);
- if(this.cloud)
- {
- _root.pointBox += cloudplus;
- this.gotoAndPlay(2);
- this.points = "+1";
- }
- else
- {
- _root.alarmSnd.start();
- _root.pointBox -= cloudminus;
- this.gotoAndStop(4);
- this.points = "-3";
- _root.health.gotoAndStop(_root.health._currentframe + 10);
- if(_root.health._currentframe == 101)
- {
- _root.endGame();
- }
- }
- }
- if(this._y <= -50 || _root.gameGoing == false)
- {
- this.onEnterFrame = undefined;
- this.removeMovieClip();
- }
- };
- endGame = function()
- {
- _root.gameGoing = false;
- clearInterval(timePassing);
- clearInterval(cloudEmitter);
- vspeed = 0;
- _root.onEnterFrame = undefined;
- Mouse.show();
- _root.endpanel.duplicateMovieClip("endresult",10000);
- _root.endresult.finalpoints = _root.pointBox;
- if(_root.endresult.finalpoints <= 0)
- {
- this.endresult.grat.gotoAndStop(4);
- }
- else if(_root.endresult.finalpoints <= 50)
- {
- this.endresult.grat.gotoAndStop(3);
- }
- else if(_root.endresult.finalpoints <= 150)
- {
- this.eendresult.grat.gotoAndStop(2);
- }
- else if(_root.endresult.finalpoints <= 1000)
- {
- this.endresult.grat.gotoAndStop(1);
- }
- _root.xyloSnd.start();
- _root.endresult.onEnterFrame = function()
- {
- this._x += (249 - this._x) / 5;
- if(this._x <= 250)
- {
- this.onEnterFrame = undefined;
- }
- };
- };
- var passedsecs = 0;
- TimePassing = function()
- {
- passedsecs++;
- if(passedsecs == 40)
- {
- _root.speedupgame();
- }
- else if(passedsecs == 80)
- {
- _root.speedupgame();
- }
- else if(passedsecs == 120)
- {
- _root.endGame();
- }
- leftsecs = 120 - passedsecs;
- minutes = Math.floor(leftsecs / 60);
- seconds = leftsecs - minutes * 60;
- if(seconds <= 9)
- {
- _root.timeBox = minutes + ":0" + seconds;
- }
- else
- {
- _root.timeBox = minutes + ":" + seconds;
- }
- };
- speedupgame = function()
- {
- vspeed++;
- };
- _root.onEnterFrame = floating;
- timePassing = setInterval(this,"TimePassing",1000);
- var musicSnd = new Sound();
- musicSnd.attachSound("music");
- var goodSnd = new Sound();
- goodSnd.attachSound("good");
-